#include <2025Linux.h>
#define NUM 10000000
void *threadFunc(void *arg){
    int *pcount = (int *)arg;
    for(int i = 0; i < NUM; ++i){
        ++*pcount;
    }
    pthread_exit(NULL);
}
int main(int argc, char *argv[])
{
    int count = 0;
    pthread_t tid;
    pthread_create(&tid,NULL,threadFunc,&count);
    for(int i = 0; i < NUM; ++i){
        ++count;
    }
    pthread_join(tid,NULL);//join的第二个参数可以写NULL，表示不获取返回值
    printf("count = %d\n", count);
    return 0;
}

